<template>
   <Header></Header>
   <router-view />
   <!-- home，search组件显示Footer组件，login,register隐藏 (注意，这里v-show不行？）-->
   <Footer v-if="$route.meta.show"></Footer>
    <!-- 配置好按自动引入后不用注册，不用引入如何文件 下面是一个表单-->
  <!-- <el-form :model="form" label-width="120px">
    <el-form-item label="Activity name">
      <el-input v-model="form.name" />
    </el-form-item>
    <el-form-item label="Activity zone">
      <el-select v-model="form.region" placeholder="please select your zone">
        <el-option label="Zone one" value="shanghai" />
        <el-option label="Zone two" value="beijing" />
      </el-select>
    </el-form-item>
    <el-form-item label="Activity time">
      <el-col :span="11">
        <el-date-picker
          v-model="form.date1"
          type="date"
          placeholder="Pick a date"
          style="width: 100%"
        />
      </el-col>
      <el-col :span="2" class="text-center">
        <span class="text-gray-500">-</span>
      </el-col>
      <el-col :span="11">
        <el-time-picker
          v-model="form.date2"
          placeholder="Pick a time"
          style="width: 100%"
        />
      </el-col>
    </el-form-item>
    <el-form-item label="Instant delivery">
      <el-switch v-model="form.delivery" />
    </el-form-item>
    <el-form-item label="Activity type">
      <el-checkbox-group v-model="form.type">
        <el-checkbox label="Online activities" name="type" />
        <el-checkbox label="Promotion activities" name="type" />
        <el-checkbox label="Offline activities" name="type" />
        <el-checkbox label="Simple brand exposure" name="type" />
      </el-checkbox-group>
    </el-form-item>
    <el-form-item label="Resources">
      <el-radio-group v-model="form.resource">
        <el-radio label="Sponsor" />
        <el-radio label="Venue" />
      </el-radio-group>
    </el-form-item>
    <el-form-item label="Activity form">
      <el-input v-model="form.desc" type="textarea" />
    </el-form-item>
    <el-form-item>
      <el-button type="primary" @click="onSubmit">Create</el-button>
      <el-button>Cancel</el-button>
    </el-form-item>
  </el-form> -->
</template>

<script>
import Header from './components/Header/index.vue'
import Footer from './components/Footer/index.vue'
import {onMounted,reactive} from 'vue'
import {useStore} from 'vuex'
// import {useRoute} from 'vue-router'
export default {
  name: 'App',
  components: {Footer,Header},
  setup() {
    const store =useStore()
    onMounted(()=>{
       // 当组件一挂载就向store里的actions分发指令---在仓库里发送ajax请求把数据存在仓库state
        store.dispatch('Category')//---请求三级分类数据
        store.dispatch('MockBanner')//--请求banner数据
        store.dispatch('MockFloor')//--请求floor数据
    })
  }
}
</script>

<style>
</style>
